package com.heima.admin.controller;

import com.heima.admin.service.AdminService;
import com.heima.model.common.dtos.AdLoginDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Lijx
 * @Date 2024-07-30 21:11
 */
@Slf4j
@RestController
@RequestMapping("/login")
public class AdminController {

    @Autowired
    private AdminService adminService;

    /**
     * 平台管理用户登录
     * @param adLoginDto
     * @return
     */
    @PostMapping("/in")
    public ResponseResult adminLogin(@RequestBody AdLoginDto adLoginDto){
        log.info("平台管理用户登录接口，入参={}",adLoginDto);
        return adminService.login(adLoginDto);
    }
}
